package com.hsc.yalebao.adapter;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.support.v4.view.PagerAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.bumptech.glide.DrawableRequestBuilder;
import com.bumptech.glide.DrawableTypeRequest;
import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestManager;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.hsc.yalebao.base.HtmlActivity;
import com.hsc.yalebao.http.AppConstants;
import com.hsc.yalebao.model.AvdBaseModel;
import com.hsc.yalebao.tabMine.ShareActivity;
import com.hsc.yalebao.tabMine.WanFaActivity;
import com.hsc.yalebao.weight.LogUtils;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.DisplayImageOptions.Builder;
import com.nostra13.universalimageloader.core.assist.ImageSize;

import java.util.ArrayList;

public class AdvViewPagerAdapter extends PagerAdapter {
    private String TAG = "-AdvViewPagerAdapter-";
    private Context context;
    private LayoutInflater inflater;
    private ImageSize mImageSize;
    private DisplayImageOptions options;
    public ArrayList<AvdBaseModel> pic_ids;

    public AdvViewPagerAdapter(ArrayList<AvdBaseModel> paramArrayList, Context paramContext) {
        this.pic_ids = paramArrayList;
        this.context = paramContext;
        this.inflater = LayoutInflater.from(paramContext);
        this.mImageSize = new ImageSize(400, 200);
        this.options = new DisplayImageOptions.Builder().cacheInMemory(true).cacheOnDisk(true)
                .resetViewBeforeLoading(true).showImageOnFail(0).bitmapConfig(Bitmap.Config.RGB_565).build();
    }

    public void destroyItem(ViewGroup paramViewGroup, int paramInt, Object paramObject) {
        paramViewGroup.removeView((View) paramObject);
    }

    public int getCount() {
        if (this.pic_ids == null)
            return 0;
        return this.pic_ids.size();
    }

    public int getItemPosition(Object paramObject) {
        return -2;
    }

    public Object instantiateItem(ViewGroup paramViewGroup, int paramInt) {
        View localView = this.inflater.inflate(2130903102, null);
        ImageView localImageView = (ImageView) localView.findViewById(2131100025);
        final AvdBaseModel localAvdBaseModel = (AvdBaseModel) this.pic_ids.get(paramInt);
        String str = AppConstants.BASE_URL_IMG + localAvdBaseModel.getImg_url();
        LogUtils.d(this.TAG, "imgUrl:" + str);
        final int i = localAvdBaseModel.getSort_index();

    }

    public boolean isViewFromObject(View paramView, Object paramObject) {
        return paramView == paramObject;
    }

}